package com.atguigu.gulimall.ware.service;

import com.atguigu.common.to.ware.HasSkuStockTo;
import com.atguigu.common.to.ware.WareSkuLockRequestTo;
import com.atguigu.common.utils.PageUtils;
import com.atguigu.gulimall.ware.entity.WareSkuEntity;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;
import java.util.Map;

/**
 * 商品库存
 *
 * @author zhough
 * @email zhough@gmail.com
 * @date 2024-01-22 20:28:15
 */
public interface WareSkuService extends IService<WareSkuEntity> {

    PageUtils queryPage(Map<String, Object> params);

    void addStock(Long skuId, Long wareId, Integer skuNum);

    List<HasSkuStockTo> hasSkuStock(List<Long> skuIds);

    void lockSkuItem(WareSkuLockRequestTo to);

    boolean unlockStockBySkuIdAndWareId(Long skuId, Long wareId, Integer num);
}

